﻿using UnityEngine;
using System.Collections;

public class EnemyControllerVoador1 : MonoBehaviour {
	
	public GameObject bullet;
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
		
	}
	
	public IEnumerator shoot(GameObject player)
	{
		GameObject newBullet = GameObject.Instantiate(bullet, transform.position, transform.rotation) as GameObject;
		newBullet.GetComponent<EnemyControllerVoador1Bullet>().player = player;
		Destroy(this.gameObject, 3f);
		yield return new WaitForSeconds(1.5f);
		StartCoroutine(shoot(player));
		
	}
	

}
